/********************************************************************************
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
 *                                                                              *
 *              This software is distributed under the terms of the             * 
 *              GNU Lesser General Public Licence (LGPL) version 3,             *  
 *                  copied verbatim in the file "LICENSE"                       *
 ********************************************************************************/
#ifndef HIMUSICMAPPEDDATA_H
#define HIMUSICMAPPEDDATA_H

#include "HiMusicWaveForm.h"
#include "TObject.h"
#include "TClonesArray.h"

class HiMusicMappedData : public TObject
{
private:
    uint64_t fEventID;
    uint8_t fDetID;
    uint8_t fNChannel;
    TClonesArray *fChanData; ////store array of HiMusicWaveForm data
    uint64_t fTimeSliceID;

public:
    HiMusicMappedData();
    HiMusicMappedData(uint64_t eventID,
                      uint8_t detID,
                      uint8_t nChannel,
                      uint64_t timeSliceID);
    HiMusicMappedData(const HiMusicMappedData &data);
    ~HiMusicMappedData();

    void Reset();
    uint64_t GetEventID() { return fEventID; }
    uint8_t GetDetID() { return fDetID; }
    uint8_t GetNumOfChannels() { return fNChannel; }
    TClonesArray *GetChannels() const { return fChanData; }
    uint64_t GetTimeSliceID() { return fTimeSliceID; }

    void SetEventID(uint64_t id) { fEventID = id; }
    void SetDetID(uint8_t id) { fDetID = id; }
    void SetNumOfChannels(uint8_t ch) { fNChannel = ch; }
    void SetTimeSliceID(uint64_t ts) { fTimeSliceID = ts; }
    void AddChannel(HiMusicWaveForm &ch) { new ((*fChanData)[fNChannel++]) HiMusicWaveForm(ch); }

	void Plot(Int_t n);

    ClassDef(HiMusicMappedData, 1);
};

#endif // !HIMUSICMAPPEDDATA_H